﻿@inject data_service _service
@{
    int column_id = Html.get_route_int("id");
    var column = await _service.get_column_details(column_id);
    int page = Html.get_query_int("page");
    int page_size = 15;
    var data_list = await _service.get_article_page(column_id, page, page_size);

    ViewData["Title"] = $"{column.column_name} - 政工列表";
}
<div class="container">
    <h3>@column.column_name</h3>
    <table class="table">
        <thead>
            <tr>
                <th>
                    标题
                </th>
                <th>
                    发布时间
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in data_list)
            {
                <tr>
                    <td>
                        <a href="/article/details/@item.id">@item.title</a>
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.create_time)
                    </td>
                </tr>
            }
        </tbody>
    </table>
    @Html.Pager(data_list, new PagerOptions
    {
    PageIndexParameterName = "page",
    TagName = "ul",
    CssClass = "pagination justify-content-center",
    CurrentPagerItemTemplate = "<li class=\"page-item active\"><a  class=\"page-link\" href=\"javascript:void(0);\">{0}</a></li>",
    DisabledPagerItemTemplate = "<li class=\"page-item disabled\"><a class=\"page-link\">{0}</a></li>",
    PagerItemTemplate = "<li class=\"page-item\">{0}</li>",
    PagerItemCssClass= "page-link",
    Id = "bootstrappager"
    })
</div>